package cn.aliang.cloud.hystrixorder.service;

import cn.aliang.cloud.service.entity.ResultMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author: chendongliang
 * @Date: 2020/7/21 10:15
 *
 *
 * 使用fallback 类的形式实现服务降级
 *
 *
 */

@Component
@FeignClient(value = "HYSTRIX-PAYMENT-SERVICE")
public interface PaymentHystrixService {

    @GetMapping("/payment/hystrix/pay/{id}")
    ResultMessage<Void> pay(@PathVariable("id") String id);


    @GetMapping("/payment/hystrix/payCircuitBreaker/{id}")
    ResultMessage<Void> payCircuitBreaker(@PathVariable("id") String id);

}
